<?php $saved_message = '';if ( !empty($_POST) 	&& isset( $_POST['es_calc_option'] )     && wp_verify_nonce( $_POST['es_calc_option'], 'es_calc_option' ) ) {              update_option( 'estatik_calculator_settings',             array(                'currency' 		 => sanitize_text_field($_POST['currency']),                'number_format' 	 => sanitize_text_field($_POST['number_format']),                'amortization_period' 	 => sanitize_text_field($_POST['amortization_period']),                'select_popup'           => sanitize_text_field($_POST['select_popup']),                'default_purchase_price' => intval(str_replace(',', '', sanitize_text_field($_POST['default_purchase_price']))),                'max_purchase_price' 	 => intval(str_replace(',', '', sanitize_text_field($_POST['max_purchase_price']))),                'down_payment' 		 => sanitize_text_field($_POST['down_payment']),                'default_down_payment'   => intval(sanitize_text_field($_POST['default_down_payment'])),                'default_term'           => intval(sanitize_text_field($_POST['default_term'])),                'max_term'           	 => intval(sanitize_text_field($_POST['max_term'])),                // 'interest_rate'          => sanitize_text_field($_POST['interest_rate']),                'default_interest_rate'  => floatval(sanitize_text_field($_POST['default_interest_rate'])),                'property_tax'           => sanitize_text_field($_POST['property_tax']),                'default_property_tax'   => intval(sanitize_text_field($_POST['default_property_tax'])),                'max_property_tax'   	 => intval(str_replace(',', '', sanitize_text_field($_POST['max_property_tax']))),                'home_insurance'         => sanitize_text_field($_POST['home_insurance']),                'default_home_insurance' => intval(sanitize_text_field($_POST['default_home_insurance'])),                'max_home_insurance' 	 => intval(str_replace(',', '', sanitize_text_field($_POST['max_home_insurance']))),                'pmi'                    => sanitize_text_field($_POST['pmi']),                'default_pmi' 	 	 => intval(str_replace(',', '', sanitize_text_field($_POST['default_pmi']))),                'max_pmi' 	 	 => intval(str_replace(',', '', sanitize_text_field($_POST['max_pmi']))),                'color'			 => sanitize_text_field($_POST['color'])            ));                $this->settings = (object)get_option('estatik_calculator_settings');        	$saved_message = _e('The settings are saved', 'es-calc');}?><div class="es_calc_options_container">	<h1><?php echo $this->page_title ?></h1>	<div class="es_calc_option_logo">        <img src="<?php echo plugin_dir_url(__FILE__) ?>/images/logo.png" alt="Estatik logo" />    </div>	<form method="post" action="" class="es_calc_option_groups">		<div class="es_calc_options_subtitle"><?php echo $this->page_subtitle ?></div>		<div class="es_calc_options_subtitle"><?php echo $saved_message ?></div>		<?php wp_nonce_field( 'es_calc_option', 'es_calc_option' ); ?>		<input type="submit" value="<?php _e('Submit', 'es-calc') ?>" class="es_calc_options_submit" />		<div class="es_calc_tabs_container">			<ul class="es_calc_tabs">				<li>					<a class="es_calc_tab active" href="#es_calc_general">						<?php _e('General settings', 'es-calc') ?>					</a>				</li>				<li>					<a class="es_calc_tab" href="#es_calc_display"><?php _e('Display settings', 'es-calc') ?></a>				</li>				<li>					<a class="es_calc_tab" href="#es_calc_color"><?php _e('Color settings', 'es-calc') ?></a>				</li>			</ul>			<div class="es_calc_options_group">				<div class="es_calc_options active" id="es_calc_general">					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Currency', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<input type="text" name="currency" class="es_calc_input"								placeholder="<?php echo $this->settings->currency ?>"								value="<?php echo $this->settings->currency ?>" />						</div>					</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Number format', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<select name="number_format">		                        <option <?php if($this->settings->number_format=='2|.|,'){ echo 'selected="selected"'; } ?> value="2|.|,">19,999.00</option>		                        <option <?php if($this->settings->number_format=='2|,|.'){ echo 'selected="selected"'; } ?> value="2|,|.">19.999,00</option>		                        <option <?php if($this->settings->number_format=='0||'){ echo 'selected="selected"'; } ?> value="0|| ">19 999</option>							</select>										</div>					</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Amortization period', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<select name="amortization_period">		                        <option value="annually"		                        	<?php if($this->settings->amortization_period=='annually')		                        		{ echo 'selected="selected"'; } ?> >		                        	<?php _e('Annually', 'es-calc') ?>		                		</option>		                        <option value="monthly"		                        	<?php if($this->settings->amortization_period=='monthly')		                        		{ echo 'selected="selected"'; } ?> >		                        	<?php _e('Monthly', 'es-calc') ?>		                		</option>							</select>										</div>					</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Select popup', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<select name="select_popup">		                        <option value="text"		                        	<?php if($this->settings->select_popup=='text')		                        		{ echo 'selected="selected"'; } ?> >		                        	<?php _e('Text', 'es-calc') ?>		                		</option>		                        <option value="graph"		                        	<?php if($this->settings->select_popup=='graph')		                        		{ echo 'selected="selected"'; } ?> >		                        	<?php _e('Text with graph', 'es-calc') ?>		                		</option>							</select>										</div>					</div>				</div>				<div class="es_calc_options" id="es_calc_display">					<div class="es_calc_pair">						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Default purchase price', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="default_purchase_price" 									class="es_calc_input es_calc_has_max"									placeholder="<?php 										echo number_format($this->settings->default_purchase_price) ?>"									value="<?php 										echo number_format($this->settings->default_purchase_price) ?>" />							</div>						</div>						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Maximum purchase price', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="max_purchase_price" 									class="es_calc_input es_calc_max_value"									placeholder="<?php echo number_format($this->settings->max_purchase_price) ?>"									value="<?php echo number_format($this->settings->max_purchase_price) ?>" />							</div>						</div>									</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Down payment', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<?php _e('No', 'es-calc') ?>							<label class="es_calc_switch">								<input type="checkbox" name="down_payment" <?php if ( $this->settings->down_payment == 'on' ) echo 'checked' ?> />								<div class="es_calc_slider"></div>							</label>							<?php _e('Yes', 'es-calc') ?>						</div>					</div>					<div class="es_calc_option 						<?php if ( $this->settings->down_payment != 'on' ) echo 'es_calc_hidden_option' ?>">						<div class="es_calc_option_name">							<?php _e('Default down payment', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<input type="text" name="default_down_payment" class="es_calc_input" 								placeholder="<?php echo number_format($this->settings->default_down_payment) ?>"								value="<?php echo number_format($this->settings->default_down_payment) ?>" />						</div>					</div>					<div class="es_calc_pair"> 						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Default term(years)', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="default_term" class="es_calc_input es_calc_has_max" 									placeholder="<?php echo $this->settings->default_term ?>"									value="<?php echo $this->settings->default_term ?>" />							</div>						</div>						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Maximum term(years)', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="max_term" class="es_calc_input es_calc_max_value" 									placeholder="<?php echo $this->settings->max_term ?>"									value="<?php echo $this->settings->max_term ?>" />							</div>						</div>					</div>					<!-- <div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Interest rate', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<?php _e('No', 'es-calc') ?>							<label class="es_calc_switch">								<input type="checkbox" name="interest_rate" <?php if ( $this->settings->interest_rate == 'on' ) echo 'checked' ?> />								<div class="es_calc_slider"></div>							</label>							<?php _e('Yes', 'es-calc') ?>						</div>					</div> -->					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Default interest rate', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<input type="number" min="0" max="100" step="0.1" class="es_calc_input percent"								name="default_interest_rate" 								placeholder="<?php echo $this->settings->default_interest_rate ?>"								value="<?php echo $this->settings->default_interest_rate ?>" /> %						</div>					</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Property tax', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<?php _e('No', 'es-calc') ?>							<label class="es_calc_switch">								<input type="checkbox" name="property_tax" <?php if ( $this->settings->property_tax == 'on' ) echo 'checked' ?> />								<div class="es_calc_slider"></div>							</label>							<?php _e('Yes', 'es-calc') ?>						</div>					</div>					<div class="es_calc_pair 						<?php if ( $this->settings->property_tax != 'on' ) echo 'es_calc_hidden_option' ?>">						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Default property tax', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="default_property_tax" 									class="es_calc_input es_calc_has_max"									placeholder="<?php 										echo number_format($this->settings->default_property_tax) ?>"									value="<?php echo number_format($this->settings->default_property_tax) ?>" />							</div>						</div>						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Maximum property tax', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="max_property_tax" 									class="es_calc_input es_calc_max_value" 									placeholder="<?php echo number_format($this->settings->max_property_tax) ?>"									value="<?php echo number_format($this->settings->max_property_tax) ?>" />							</div>						</div>					</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Home insurance', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<?php _e('No', 'es-calc') ?>							<label class="es_calc_switch">								<input type="checkbox" name="home_insurance" <?php if ( $this->settings->home_insurance == 'on' ) echo 'checked' ?> />								<div class="es_calc_slider"></div>							</label>							<?php _e('Yes', 'es-calc') ?>						</div>					</div>					<div class="es_calc_pair 						<?php if ( $this->settings->home_insurance != 'on' ) echo 'es_calc_hidden_option' ?>">						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Default home insurance', 'es-calc') ?>:							</div> 							<div class="es_calc_option_value">								<input type="text" name="default_home_insurance" 									class="es_calc_input es_calc_has_max" 									placeholder="<?php 										echo number_format($this->settings->default_home_insurance) ?>"									value="<?php 										echo number_format($this->settings->default_home_insurance) ?>" />							</div>						</div>						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Maximum home insurance', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="max_home_insurance" 									class="es_calc_input es_calc_max_value"									placeholder="<?php echo number_format($this->settings->max_home_insurance) ?>"									value="<?php echo number_format($this->settings->max_home_insurance) ?>" />							</div>						</div>					</div>					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('PMI', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<?php _e('No', 'es-calc') ?>							<label class="es_calc_switch">								<input type="checkbox" name="pmi" <?php if ( $this->settings->pmi == 'on' ) echo 'checked' ?> />								<div class="es_calc_slider"></div>							</label>							<?php _e('Yes', 'es-calc') ?>						</div>					</div>					<div class="es_calc_pair <?php if ( $this->settings->pmi != 'on' ) echo 'es_calc_hidden_option' ?>">						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Default PMI', 'es-calc') ?>							</div>							<div class="es_calc_option_value">								<input type="text" name="default_pmi" class="es_calc_input es_calc_has_max"									placeholder="<?php echo $this->settings->default_pmi ?>"									value="<?php echo $this->settings->default_pmi ?>" />							</div>						</div>						<div class="es_calc_option">							<div class="es_calc_option_name">								<?php _e('Maximum PMI', 'es-calc') ?>:							</div>							<div class="es_calc_option_value">								<input type="text" name="max_pmi" 									class="es_calc_input es_calc_max_value"									placeholder="<?php echo number_format($this->settings->max_pmi) ?>"									value="<?php echo number_format($this->settings->max_pmi) ?>" />							</div>						</div>					</div>				</div>				<div class="es_calc_options" id="es_calc_color">					<div class="es_calc_option">						<div class="es_calc_option_name">							<?php _e('Change color', 'es-calc') ?>:						</div>						<div class="es_calc_option_value">							<input type="text" value="<?php echo $this->settings->color ?>" 								class="my-color-field" data-default-color="#60d401" name="color" />						</div>					</div>				</div>			</div>		</div>	</form>	</div>